package com.blast.comicsisland.model.rank.rankhead;

import com.blast.comicsisland.model.recommend.recommendhead.AdListJson;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.LinkedList;
import java.util.List;

/**
 * Created by dell on 2015/6/24.
 */
public class Info {
    //字段名称adlistjson
    private List<AdListJson> adlistjson;

    public List<AdListJson> getAdlistjson() {
        return adlistjson;
    }

    public void setAdlistjson(List<AdListJson> adlistjson) {
        this.adlistjson = adlistjson;
    }

    public void jsonParse(JSONObject jsonObject){
        adlistjson = new LinkedList<AdListJson>();

        try {
            JSONArray jsonArray = jsonObject.getJSONArray("adlistjson");
            for (int i = 0; i < jsonArray.length(); i++) {
                AdListJson adListJson = new AdListJson();
                JSONObject object = jsonArray.getJSONObject(i);
                adListJson.jsonParse(object);
                adlistjson.add(adListJson);
            }


        } catch (JSONException e) {
            e.printStackTrace();
        }

    }

}
